<?php

$array = array("overall", "attack", "defence", "strength", "hitpoints", "ranged", "prayer", "magic", "cooking", "wc", "fletching", "fishing", "firemaking", "crafting", "smithing", "mining", "herblore", "agility", "thieving", "slayer", "farming", "rc", "hunter", "construct", "summoning");
$array2 = array("rank", "level", "xp");

$var1 = 'CREATE TABLE IF NOT EXISTS `rst_data` ('
  . '`id` int unsigned NOT NULL AUTO_INCREMENT,'
  . '`user_id` int(10) unsigned DEFAULT NULL,';
 
$var2 = '';
foreach($array as $value) {
	foreach($array2 as $value2) {
		$var3 = $value . '_' . $value2 . " int(10) unsigned DEFAULT NULL,";
		$var2 = $var2. $var3;
		}
	}

$var4 = 'PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1';	
	
	
mysql_query($var1 . $var2 . $var4);
?>